package com.nami.conver.infra.impl;

import com.nami.conver.domain.disruptor.handler.request.ConverTaskAddRequest;
import com.nami.conver.domain.repository.ConverTaskRepository;
import com.nami.conver.infra.convertor.ConverTaskConvert;
import com.nami.conver.infra.mapper.ConverTaskMapper;
import com.nami.conver.infra.orm.model.ConverTaskDO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;


@Slf4j
@Component
@RequiredArgsConstructor
public class ConverTaskRepositoryImpl implements ConverTaskRepository {

    private final ConverTaskMapper converTaskMapper;

    @Override
    public void batchSave(List<ConverTaskAddRequest> requests) {
        List<ConverTaskDO> list = ConverTaskConvert.INSTANCE.convertList(requests);
        converTaskMapper.insert(list);
    }

}
